package org.calzz.example.crud;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.simple.ParameterizedRowMapper;

public class ProductMapper implements ParameterizedRowMapper<ProductDTO> {

	@Override
	public ProductDTO mapRow(ResultSet rs, int rowNum) throws SQLException {

		ProductDTO product = new ProductDTO();

		product.setProductId(rs.getInt("product_id"));
		product.setName(rs.getString("name"));
		product.setPrice(rs.getDouble("price"));

		return product;
	}

}
